package com.ant.storage.mapper;

import com.ant.storage.dto.ChannelDto;
import com.ant.storage.dto.PurchaseOrdersDto;
import com.ant.storage.pojo.InventoryLog;
import com.ant.storage.pojo.PurchaseOrders;
import com.ant.storage.vo.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author melon
 * @since 2022-03-16
 */
public interface PurchaseOrdersMapper extends BaseMapper<PurchaseOrders> {

    String selectlastID();

    List<PurchaseOrders> getPurchaseOrderList(Map<String, Object> params);

    List<PurchaseOrders> getPurchaseOrderPage(@Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);

    Integer getPurchaseOrderCount();

    List<PurchaseReportVo> getList(@Param("pageIndex") Integer pageIndex,
                                   @Param("pageSize") Integer pageSize,
                                   @Param("depId") Integer depId,
                                   @Param("channelId") Integer channelId,
                                   @Param("purchaserId") Integer purchaserId,
                                   @Param("times") String[] times);


    Integer getListCount(@Param("depId") Integer depId,
                 @Param("channelId") Integer channelId,
                 @Param("purchaserId") Integer purchaserId,
                 @Param("times") String[] times);

    List<DepVo> getDepCensus(@Param("depId") Integer depId,
                             @Param("times") String[] times);

    List<DepVo>  getChannelCensus(@Param("dto") ChannelDto dto);


    List<DepVo> getDepCensusReport(@Param("depId") Integer depId, @Param("times") String[] times);

    List<WarehouseCensusVo> getWarehouseCensus();

    List<WarehouseCensusListVo> getWarehouseCensusList(@Param("pageIndex") Integer pageIndex,
                                                       @Param("pageSize") Integer pageSize,
                                                       @Param("warehouseId") Integer  warehouseId);

    Integer getWarehouseCensusListCount(@Param("pageIndex") Integer pageIndex,
                                                       @Param("pageSize") Integer pageSize,
                                                       @Param("warehouseId") Integer  warehouseId);


    List<InventoryLog>  inventoryLog(@Param("id") Integer  id);

    List<CommodityVo> selectCommodityVo(@Param("purchaserId") Integer purchaserId,@Param("parentId")  Integer parentId);

    List< PurchaseVo> selectbyId(@Param("dto") PurchaseOrdersDto dto);
    Integer  selectTotal();

    List<SupplierVo> selectCensus(@Param("supplierId") Integer supplierId);

    List<SupplierCensusVo> selectSupplierPayCensus();

    List<CommodityVo> selectCommodityVos(@Param("id") Integer id,@Param("parentId")  Integer parentId);

    List<PurAmountvVo> getReportPurAmount();

    List<SingleVo> selectSinglet(@Param("nameId") Integer nameId);

    List<SingleVo> selectPlanSinglet(@Param("nameId") Integer nameId);
}
